home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)Z / (A)Z8.ADF / Pyro! / Runb.doc < prev    next >
Text File  |  1989-06-27  |  4KB  |  101 lines

  1.  
  2.   /* Runbackground */
  3.   /* Original Author:  Rob Peck.  5/9/86 */
  4.   /* VERY slightly modified by K.Mardam-Bey 6/20/88 */
  5.  
  6.   This program is a modification of *ROB PECK*'s original RUNBACKGROUND
  7.   program. I added a few lines of code to his C source, and compiled
  8.   it - all in less than five minutes.
  9.  
  10.   The program RUNBACK is a VERY useful tool, however, it has one
  11.   MAJOR fault that drives me CRAZY - if the program you want to
  12.   RUNBACK isn't in the current directory, then you HAVE to specify
  13.   a path.
  14.  
  15.     I have CHANGED this. It was very simple; just a few lines of
  16.   code. If you specify a path, then this version of RUNBACK will try
  17.   to get at the file in the directory you specified. If it doesn't
  18.   find the program in the directory you specified, it exits.
  19.  
  20.   *BUT*, if you do NOT specify a path, then it looks for the program
  21.   first in the current directory, and then the C: directory, then it
  22.   looks in DF0:C and then DF1:C. If by then it doesn't find the program
  23.   it just exits.
  24.  
  25.   tadaaaaaaaaa! :-)
  26.  
  27.   Oh yeah, it also has the added nicety of avoiding the system
  28.   requestor if you try to access a non-existent device :-)
  29.  
  30.   NOTE - the "RUN" command MUST be in the C: directory for this
  31.   program to work.
  32.  
  33.     I had both the C source and the assembly source for this program but
  34.   since I don't know how to program in assembly, I used Rob Pecks C
  35.   source. if anyone out there would like to change the assembly version
  36.   to what I've done here (which should be VERY easy), please do so. As you
  37.   can see, the size of this RUNBACK is many times larger than it's assembly
  38.   language counterpart. (which shouldn't really be a problem for hard-disk
  39.   owners, but may be on the "large side" for us floppy-drive amigans :-).
  40.  
  41.    well, as always,
  42.                have fun..
  43.                    Khaled Mardam-Bey.
  44.  
  45.   ID on PeopleLink and Portal : LAD
  46.  
  47. ***************************************************************************
  48.  
  49. The following description comes from the original runbackground.c:
  50.  
  51. ***************************************************************************
  52. --------------
  53. runbackground.c  
  54. ---------------
  55.  
  56. SUMMARY:  A Workbench Disk can be used to autostart an application
  57.       through the use of the startup script and close the startup CLI.
  58.  
  59.  
  60. Users have commented that it is not possible to start a process going 
  61. from the startup script and then cause the initial CLI to go away.   
  62. Here is the solution to that problem, named appropriately:
  63.  
  64.     RUNBACKGROUND
  65.  
  66. which starts and runs a background task.  This does indeed allow you to
  67. create a startup script that will set up your workbench running any
  68. programs you might wish, removing the initial CLI in the process.
  69.  
  70. Your s/startup-sequence can contain lines such as the following:
  71.  
  72.     RUNBACKGROUND -3 clock
  73.     RUNBACKGROUND utilities/calculator
  74.     RUNBACKGROUND -5 utilities/notepad
  75.  
  76. where RUNBACKGROUND is the command and the second parameter is the filename
  77. which may be preceded by a flag-variable that specifies an optional delay 
  78. time.  The delay can be from 0 to 9, for the number of seconds that 
  79. the startup script should sleep while allowing the background task to 
  80. load and start.  I've put that in to minimize thrashing of the disk as it
  81. tries to load several projects at once.
  82.  
  83.  
  84. LIMITATIONS:
  85.  
  86.     The program that you run cannot require any input from an interactive
  87.     CLI that starts it.    Additionally, you cannot specify any file 
  88.     redirection in the command line since this program provides the
  89.     redirection for you already.  If you need to use redirection for
  90.     your command, you can modify the source code where shown, thus
  91.     allowing the redirection to become one of the parameters passed
  92.     through to your program.
  93.  
  94.     RUNBACKGROUND does pass your command line parameters to the program
  95.     you wish to start, but limits the total length of your command
  96.     string to 227 (255 minus the 28 characters for "RUN >NIL: <NIL: " 
  97.     preceding your own file pathname and ">NIL: < NIL: " following it.)
  98.  
  99.  
  100. **********************************************************************
  101.